package k8.util;

import java.nio.DoubleBuffer;

import org.lwjgl.BufferUtils;

public final class Matrix
{
	// Transformation matrix
	public static final DoubleBuffer matrix = BufferUtils.createDoubleBuffer(16);

	// Identity matrix
	private static final double[] IDENTITY_MATRIX =
		new double[] {
			1.0, 0.0, 0.0, 0.0,
			0.0, 1.0, 0.0, 0.0,
			0.0, 0.0, 1.0, 0.0,
			0.0, 0.0, 0.0, 1.0 };

	// Orientation vectors
	public static final double[] forward = new double[3];
	public static final double[] side = new double[3];
	public static final double[] up = new double[3];
	
	/**
	 * Make matrix an identity matrix
	 */
	public static void makeIdentity(DoubleBuffer m) {
		int oldPos = m.position();
		m.put(IDENTITY_MATRIX);
		m.position(oldPos);
	}
}
